package com.tech.koufu.ui.activity.menu;

import com.tech.koufu.R;
 



import com.tech.koufu.ui.view.CompetitinListView;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.TextView;

/** 
 * @ClassName: MyCompetitions
 * @Description: TODO(我的大赛)  
 * @author 123
 * @date 2015年5月10日 下午5:52:08
 */
public class MyCompetitions extends FragmentActivity implements OnClickListener{
	FrameLayout content;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {   
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu_list_compes);
		initView();
		initFragment();
	}
	
 
	private void initView(){
		TextView tt = (TextView)findViewById(R.id.tv_title);
		tt.setText(R.string.menu_myCompetition);
		findViewById(R.id.img_callback).setOnClickListener(this);
		content = (FrameLayout)findViewById(R.id.fg);
	}
	private void initFragment(){
		CompetitinListView competitinListView = new CompetitinListView();
		Bundle bundle = new Bundle();
		bundle.putInt("index", 2);
		competitinListView.setArguments(bundle);
		FragmentManager fManager = getSupportFragmentManager();
		FragmentTransaction fragmentTransaction = fManager.beginTransaction(); 
		fragmentTransaction.add(R.id.fg, competitinListView);
		fragmentTransaction.commit();
	}
	@Override
	public void onClick(View v) { 
		switch (v.getId()) {
		case R.id.img_callback:
			this.finish();
			break;

		default:
			break;
		}
		
	}
	
}
